#!/bin/sh

# 配置uhttpd
uci add_list uhttpd.main.listen_http='0.0.0.0:8001'
uci add_list uhttpd.main.listen_http='[::]:8001'
uci add_list uhttpd.main.listen_https='0.0.0.0:4431'
uci add_list uhttpd.main.listen_https='[::]:4431'
uci add firewall rule
uci set firewall.@rule[-1].name='Allow-HTTP1'
uci add_list firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].dest_port='8001'
uci set firewall.@rule[-1].target='ACCEPT'
uci add firewall rule
uci set firewall.@rule[-1].name='Allow-HTTPS1'
uci add_list firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].dest_port='4431'
uci set firewall.@rule[-1].target='ACCEPT'
uci commit
/etc/init.d/uhttpd restart
